package com.emergency.examine.dao;

import com.emergency.base.domain.ScenarWeather;
import com.emergency.examine.domain.Answer;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface AnswerDao extends JpaRepository<Answer, Long>, JpaSpecificationExecutor<Answer> {
    @Modifying
    @Query(value = "delete FROM ex_answer WHERE question_id = ? ", nativeQuery = true)
    void deleteByQuestionId(Long questionid);

    @Query("select an from Answer an where question.id=:questionid ")
    Answer findByQuestionId(Long questionid);
}
